// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

using System;
using System.Threading;
using System.Threading.Tasks;

#nullable restore
namespace Elastic.Clients.Elasticsearch.Migration
{
	public class MigrationNamespace : NamespacedClientProxy
	{
		internal MigrationNamespace(ElasticsearchClient client) : base(client)
		{
		}

		public MigrationDeprecationsResponse Deprecations(MigrationDeprecationsRequest request)
		{
			request.BeforeRequest();
			return DoRequest<MigrationDeprecationsRequest, MigrationDeprecationsResponse>(request);
		}

		public Task<MigrationDeprecationsResponse> DeprecationsAsync(MigrationDeprecationsRequest request, CancellationToken cancellationToken = default)
		{
			request.BeforeRequest();
			return DoRequestAsync<MigrationDeprecationsRequest, MigrationDeprecationsResponse>(request, cancellationToken);
		}

		public MigrationDeprecationsResponse Deprecations()
		{
			var descriptor = new MigrationDeprecationsRequestDescriptor();
			descriptor.BeforeRequest();
			return DoRequest<MigrationDeprecationsRequestDescriptor, MigrationDeprecationsResponse>(descriptor);
		}

		public MigrationDeprecationsResponse Deprecations(Action<MigrationDeprecationsRequestDescriptor> configureRequest)
		{
			var descriptor = new MigrationDeprecationsRequestDescriptor();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<MigrationDeprecationsRequestDescriptor, MigrationDeprecationsResponse>(descriptor);
		}

		public MigrationDeprecationsResponse Deprecations<TDocument>(Action<MigrationDeprecationsRequestDescriptor<TDocument>> configureRequest)
		{
			var descriptor = new MigrationDeprecationsRequestDescriptor<TDocument>();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<MigrationDeprecationsRequestDescriptor<TDocument>, MigrationDeprecationsResponse>(descriptor);
		}

		public Task<MigrationDeprecationsResponse> DeprecationsAsync(CancellationToken cancellationToken = default)
		{
			var descriptor = new MigrationDeprecationsRequestDescriptor();
			descriptor.BeforeRequest();
			return DoRequestAsync<MigrationDeprecationsRequestDescriptor, MigrationDeprecationsResponse>(descriptor);
		}

		public Task<MigrationDeprecationsResponse> DeprecationsAsync(Action<MigrationDeprecationsRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new MigrationDeprecationsRequestDescriptor();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<MigrationDeprecationsRequestDescriptor, MigrationDeprecationsResponse>(descriptor);
		}

		public Task<MigrationDeprecationsResponse> DeprecationsAsync<TDocument>(Action<MigrationDeprecationsRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new MigrationDeprecationsRequestDescriptor<TDocument>();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<MigrationDeprecationsRequestDescriptor<TDocument>, MigrationDeprecationsResponse>(descriptor);
		}

		public MigrationGetFeatureUpgradeStatusResponse GetFeatureUpgradeStatus(MigrationGetFeatureUpgradeStatusRequest request)
		{
			request.BeforeRequest();
			return DoRequest<MigrationGetFeatureUpgradeStatusRequest, MigrationGetFeatureUpgradeStatusResponse>(request);
		}

		public Task<MigrationGetFeatureUpgradeStatusResponse> GetFeatureUpgradeStatusAsync(MigrationGetFeatureUpgradeStatusRequest request, CancellationToken cancellationToken = default)
		{
			request.BeforeRequest();
			return DoRequestAsync<MigrationGetFeatureUpgradeStatusRequest, MigrationGetFeatureUpgradeStatusResponse>(request, cancellationToken);
		}

		public MigrationGetFeatureUpgradeStatusResponse GetFeatureUpgradeStatus()
		{
			var descriptor = new MigrationGetFeatureUpgradeStatusRequestDescriptor();
			descriptor.BeforeRequest();
			return DoRequest<MigrationGetFeatureUpgradeStatusRequestDescriptor, MigrationGetFeatureUpgradeStatusResponse>(descriptor);
		}

		public MigrationGetFeatureUpgradeStatusResponse GetFeatureUpgradeStatus(Action<MigrationGetFeatureUpgradeStatusRequestDescriptor> configureRequest)
		{
			var descriptor = new MigrationGetFeatureUpgradeStatusRequestDescriptor();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<MigrationGetFeatureUpgradeStatusRequestDescriptor, MigrationGetFeatureUpgradeStatusResponse>(descriptor);
		}

		public Task<MigrationGetFeatureUpgradeStatusResponse> GetFeatureUpgradeStatusAsync(CancellationToken cancellationToken = default)
		{
			var descriptor = new MigrationGetFeatureUpgradeStatusRequestDescriptor();
			descriptor.BeforeRequest();
			return DoRequestAsync<MigrationGetFeatureUpgradeStatusRequestDescriptor, MigrationGetFeatureUpgradeStatusResponse>(descriptor);
		}

		public Task<MigrationGetFeatureUpgradeStatusResponse> GetFeatureUpgradeStatusAsync(Action<MigrationGetFeatureUpgradeStatusRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new MigrationGetFeatureUpgradeStatusRequestDescriptor();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<MigrationGetFeatureUpgradeStatusRequestDescriptor, MigrationGetFeatureUpgradeStatusResponse>(descriptor);
		}

		public MigrationPostFeatureUpgradeResponse PostFeatureUpgrade(MigrationPostFeatureUpgradeRequest request)
		{
			request.BeforeRequest();
			return DoRequest<MigrationPostFeatureUpgradeRequest, MigrationPostFeatureUpgradeResponse>(request);
		}

		public Task<MigrationPostFeatureUpgradeResponse> PostFeatureUpgradeAsync(MigrationPostFeatureUpgradeRequest request, CancellationToken cancellationToken = default)
		{
			request.BeforeRequest();
			return DoRequestAsync<MigrationPostFeatureUpgradeRequest, MigrationPostFeatureUpgradeResponse>(request, cancellationToken);
		}

		public MigrationPostFeatureUpgradeResponse PostFeatureUpgrade()
		{
			var descriptor = new MigrationPostFeatureUpgradeRequestDescriptor();
			descriptor.BeforeRequest();
			return DoRequest<MigrationPostFeatureUpgradeRequestDescriptor, MigrationPostFeatureUpgradeResponse>(descriptor);
		}

		public MigrationPostFeatureUpgradeResponse PostFeatureUpgrade(Action<MigrationPostFeatureUpgradeRequestDescriptor> configureRequest)
		{
			var descriptor = new MigrationPostFeatureUpgradeRequestDescriptor();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<MigrationPostFeatureUpgradeRequestDescriptor, MigrationPostFeatureUpgradeResponse>(descriptor);
		}

		public Task<MigrationPostFeatureUpgradeResponse> PostFeatureUpgradeAsync(CancellationToken cancellationToken = default)
		{
			var descriptor = new MigrationPostFeatureUpgradeRequestDescriptor();
			descriptor.BeforeRequest();
			return DoRequestAsync<MigrationPostFeatureUpgradeRequestDescriptor, MigrationPostFeatureUpgradeResponse>(descriptor);
		}

		public Task<MigrationPostFeatureUpgradeResponse> PostFeatureUpgradeAsync(Action<MigrationPostFeatureUpgradeRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new MigrationPostFeatureUpgradeRequestDescriptor();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<MigrationPostFeatureUpgradeRequestDescriptor, MigrationPostFeatureUpgradeResponse>(descriptor);
		}
	}
}